/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.gov.cemaden.library.repository.previsao;

import br.gov.cemaden.library.model.previsao.PrevisaoPrecipitacao;
import javax.persistence.EntityManager;

/**
 *
 * @author alan.oliveira
 */
public class PrevisaoPrecipitacaoRepository {
    
    private final EntityManager em;

    public PrevisaoPrecipitacaoRepository(EntityManager em) {
        this.em = em;
    }
    
    public PrevisaoPrecipitacao update(PrevisaoPrecipitacao previsao) {
        em.getTransaction().begin();
        previsao = em.merge(previsao);
        em.getTransaction().commit();
        return previsao;
    }
    
}
